package com.qwz.common;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
/**
* @Description: 统一关闭数据库操作
* @Package com.qwz.common.DbClose
* @author Qiuwuzhi
* @date 2019/12/23 11:02
* @version V1.0
*/
public class DbClose {

    public static void close(Connection conn, Statement ps, ResultSet rs) {
        try {
            if (rs != null) {
                rs.close();
                rs = null;
            }
            if (ps != null) {
                ps.close();
                ps = null;

            }
            if (conn != null) {
                conn.close();
                conn = null;
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
